package com.example.demo.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.demo.common.Result;
import com.example.demo.entity.VideoInfo;
import com.example.demo.entity.VideoTag;
import com.example.demo.mapper.VideoTagMapper;
import com.example.demo.utils.Util;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 第五小组
 * @since 2021-08-04
 */
@RestController
@RequestMapping("/bilibili")
public class VideoTagController {

    @Autowired
    VideoTagMapper videoTagMapper;

    //根据bv查数据库里的视频标签
    @GetMapping("/video_tag")
    public Result video_tag(@RequestParam("bv") String bv, HttpServletResponse response){
        return Result.succ(videoTagMapper.selectOne(new QueryWrapper<VideoTag>().eq("BV_bid",bv)));
    }
}
